﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MyVideoPlayer.Models
{
    /// <summary>
    /// 媒体窗口模型
    /// </summary>
    public class MainWindowModel : ObservableObject
    {
        private ObservableCollection<MovieInfo> movies = [];
        /// <summary>
        /// 视频列表
        /// </summary>
        public ObservableCollection<MovieInfo> Movies
        {
            get => movies;
            set => SetProperty(ref movies, value);
        }

        private MovieInfo? selectedMovie;
        /// <summary>
        /// 当前选中的视频
        /// </summary>
        public MovieInfo? SelectedMovie
        {
            get => selectedMovie;
            set => SetProperty(ref selectedMovie, value);
        }

        private Uri? selectedMovieUri;
        /// <summary>
        /// 当前选中的视频地址
        /// </summary>
        public Uri? SelectedMovieUri
        {
            get => selectedMovieUri;
            set => SetProperty(ref selectedMovieUri, value);
        }

        private double totalDuration;
        /// <summary>
        /// 视频总时长
        /// </summary>
        public double TotalDuration
        {
            get => totalDuration;
            set => SetProperty(ref totalDuration, value);
        }

        private double currentPosition;
        /// <summary>
        /// 视频当前播放位置
        /// </summary>
        public double CurrentPosition
        {
            get => currentPosition;
            set => SetProperty(ref currentPosition, value);
        }

        private string? currentDuration;
        /// <summary>
        /// 视频当前播放时间
        /// </summary>
        public string? CurrentDuration
        {
            get => currentDuration;
            set => SetProperty(ref currentDuration, value);
        }

        private string? remainDuration;
        /// <summary>
        /// 剩余视频时长
        /// </summary>
        public string? RemainDuration
        {
            get => remainDuration;
            set => SetProperty(ref remainDuration, value);
        }

        private bool isPlaying;
        /// <summary>
        /// 是否正在播放
        /// </summary>
        public bool IsPlaying
        {
            get => isPlaying;
            set => SetProperty(ref isPlaying, value);
        }

        private SettingModel settingModel = new();
        /// <summary>
        /// 设置
        /// </summary>
        public SettingModel SettingModel
        {
            get => settingModel;
            set => SetProperty(ref settingModel, value);
        }
    }
}